import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import store from './store'
import usePermission from '~/utils/use-permission'

// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)
app.use(store)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.use(ElementPlus)

import 'virtual:windi.css'

import './permission'

app.config.globalProperties.$usePermission = usePermission

store.dispatch('loadLocalAction')

app.use(router)

app.mount('#app')
